package com.xysd.examproject.activity;

import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;

import com.xysd.examproject.R;
import com.xysd.examproject.base.BottomTabBaseActivity;
import com.xysd.examproject.fragment.HomeFragment;
import com.xysd.examproject.fragment.MineFragment;
import com.xysd.examproject.fragment.SecondFragment;
import com.xysd.examproject.fragment.ThirdFragment;
import com.xysd.examproject.widget.BottomTabView;

import java.util.ArrayList;
import java.util.List;

public class HomePageActivity extends BottomTabBaseActivity {

    List<Fragment> fragments;
    List<BottomTabView.TabItemView> tabItemViews;




    protected List<BottomTabView.TabItemView> getTabViews(){
        tabItemViews=new ArrayList<BottomTabView.TabItemView>();
        BottomTabView.TabItemView tabHome=new BottomTabView.TabItemView(this,"首页",R.color.black,R.color.red, R.mipmap.ic_launcher,R.mipmap.linkman);
        BottomTabView.TabItemView tabSecond=new BottomTabView.TabItemView(this,"第二",R.color.black,R.color.red, R.mipmap.ic_launcher,R.mipmap.linkman);
        BottomTabView.TabItemView tabThird=new BottomTabView.TabItemView(this,"第三",R.color.black,R.color.red, R.mipmap.ic_launcher,R.mipmap.linkman);
        BottomTabView.TabItemView tabMine=new BottomTabView.TabItemView(this,"我的",R.color.black,R.color.red, R.mipmap.ic_launcher,R.mipmap.linkman);
        tabItemViews.add(tabHome);
        tabItemViews.add(tabSecond);
        tabItemViews.add(tabThird);
        tabItemViews.add(tabMine);
        return tabItemViews;
    }
    protected List<Fragment> getFragments(){
        fragments=new ArrayList<Fragment>();
        HomeFragment homefragment=new HomeFragment();
        SecondFragment secondFragment=new SecondFragment();
        ThirdFragment thirdFragment=new ThirdFragment();
        MineFragment mineFragment=new MineFragment();
        fragments.add(homefragment);
        fragments.add(secondFragment);
        fragments.add(thirdFragment);
        fragments.add(mineFragment);
        return fragments;
    }

    protected View getCenterView(){
        View view= LayoutInflater.from(this).inflate(R.layout.view_tab_center,null);
        return view;
    }



    @Override
    protected void onResume() {
        super.onResume();
    }

    WindowManager mWindowManager;
    WindowManager.LayoutParams mWindowManagerParams;
    View mEmptyView;
    private void forbiddenHomeKey(){
        mWindowManager = this.getWindowManager();
        mWindowManagerParams = new WindowManager.LayoutParams();
        mWindowManagerParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
        mWindowManagerParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
        // internal system error windows, appear on top of everything they can
        mWindowManagerParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
        // indicate this view don’t respond the touch event
        mWindowManagerParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
        // add an empty view on the top of the window
        mEmptyView = new View(this);
        mWindowManager.addView(mEmptyView, mWindowManagerParams);
    }


}
